const controller = require('./controller')

module.exports = (req, res) => {
  if (req.method === 'GET') {
    if (req.url === '/') {
      controller.index(res)
    }
    if(req.url === '/wenchuang.png'){
      controller.imageFile(req.url, res)
    }
  } else if(req.method === 'POST'){
    if(req.url === '/login'){
      controller.login(req, res)
    }
  }
}